package com.example.utils;

import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.Locale;

public class DateGenerator {
	private int day;
	private String month;
	private int year;
	
	public DateGenerator() {
        year = generateRandomBetween(1900, 2010);
        int intMonth = generateRandomBetween(0, 11);
        GregorianCalendar gc = new GregorianCalendar(year, intMonth, 1);
        day = generateRandomBetween(1, gc.getActualMaximum(Calendar.DAY_OF_MONTH));
        DateFormatSymbols dfs = new DateFormatSymbols(Locale.ENGLISH);
        String[] months = dfs.getMonths();
        month = months[intMonth];          
	}
	
	public int generateRandomBetween(int start, int end) {
        return start + (int)Math.round(Math.random() * (end - start));
    }

	public int getDay() {
		return day;
	}

	public String getMonth() {
		return month;
	}

	public int getYear() {
		return year;
	}	
}
